package com.panshi.api;


import com.panshi.po.Answer;
import com.panshi.po.AnswerAudit;
import com.panshi.po.CommentList;
import com.panshi.po.RevertAll;
import com.panshi.vo.Result;
import com.panshi.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="hasbei-answer",path = "answer-api")
@Component
@Api(tags = "回答接口")
public interface AnswerApi {

    @ApiOperation("审核增加")
    @PostMapping("/save")
    Result save(@RequestBody SaveAnswerVO saveAnswerVO);

    @ApiOperation("查询(审核)")
    @PostMapping("/queryAnswer")
    Result<List<AnswerAudit>> queryAnswer(@RequestBody QueryAnswerAuditVO queryAnswerAuditVO);

    @ApiOperation("查询总数(审核)")
    @PostMapping("/queryAuditCount")
    Result<Integer> queryAuditCount(@RequestBody QueryAnswerAuditVO queryAnswerAuditVO);

    @ApiOperation("上下架(修改)")
    @PostMapping("/updChoose")
    Result updChoose(@RequestBody UpdAnswerChooseVO updAnswerChooseVO);

    @ApiOperation("审核删除")
    @GetMapping("/delUncheck")
    Result delUncheck(Long id);

    @ApiOperation("修改审核内容")
    @PutMapping("/upd")
    Result update(@RequestBody UpdAnswerUncheckedVO updAnswerUncheckedVO) ;

    @ApiOperation("修改审核状态")
    @PutMapping("/updState")
    Result updStatus(@RequestBody UpdAnswerUncheckedStatusVO updAnswerUncheckedStatusVO);

    @ApiOperation("删除")
    @DeleteMapping("/del")
    Result del(Long id);

    @ApiOperation("查询回答数据")
    @PostMapping("/selectPage")
    Result<List<Answer>> selectPage(@RequestBody QueryAnswerVO queryAnswerVO) ;

    @ApiOperation("查询总数(通过)")
    @PostMapping("/queryCount")
    Result<Integer> queryCount(@RequestBody QueryAnswerVO queryAnswerVO);

    @ApiOperation("增加回答评论")
    @PostMapping("/saveComment")
    Result saveComment(@RequestBody SaveCommentVO saveCommentVO);

    @ApiOperation("回答&回答评论 点踩")
    @PostMapping("/option")
    Result option(@RequestBody SaveOptionVO saveOptionVO);

    @ApiOperation("查询子回复")
    @PostMapping("/revertAll")
    Result<List<RevertAll>> revertAll(@RequestBody QueryCommentVO queryCommentVO);

    @ApiOperation("查询评论")
    @PostMapping("/commentlist")
    Result<List<CommentList>> commentlist(@RequestBody QueryCommentVO queryCommentVO);

    @ApiOperation("/回复总数")
    @PostMapping("commentCount")
    Result<Integer> commentCount(@RequestBody QueryCommentVO queryCommentVO);
}
